/**
 * @Description: 插件入口,注册所有插件
 * @Author bianpengfei
 * @create 2021/5/14 18:15
 */
import { requireAllModule, isFunction } from '@bianpengfei/utils'

export default {
  install: (app) => {
    requireAllModule({
      requireContext: require.context('./modules/', true, /\.js$/),
      exclude: []
    }).forEach(([v]) => {
      if (isFunction(v?.default?.install)) {
        app.use(v?.default)
      }
    })
  }
}
